package kofman.test.cps;

import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.os.Bundle;
import android.util.Log;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

public class checkboxView extends Activity {
	CheckBox box,box2,box3;
	TextView view,view2,view3;
	EditText text,text2,text3;
	OnCheckedChangeListener checkBoxListener;
	public void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);
		setContentView(R.layout.checkboxview);

		text=(EditText)findViewById(R.id.editView01);
		text.setEnabled(false);
		text2=(EditText)findViewById(R.id.editView02);
		text2.setEnabled(false);
		text3=(EditText)findViewById(R.id.editView03);
		text3.setEnabled(false);
		
		view=(TextView)findViewById(R.id.TextView01);
		view2=(TextView)findViewById(R.id.TextView02);
		view3=(TextView)findViewById(R.id.TextView03);
		box=(CheckBox)findViewById(R.id.checkBox);
		box2=(CheckBox)findViewById(R.id.checkBox2);
		box3=(CheckBox)findViewById(R.id.checkBox3);

		checkBoxListener=new OnCheckedChangeListener() {
			public void onCheckedChanged(CompoundButton button, boolean isChecked) {
				Log.d("site", "onCheckedChanged: "+button.getText());
				if(button.isChecked()){
					
					Toast.makeText(getBaseContext(), button.getText(), Toast.LENGTH_LONG).show();
					text.setEnabled(true);
				}else{
					text.setEnabled(false);
				}
				
			}
		};
		box.setOnCheckedChangeListener(checkBoxListener);
		box2.setOnCheckedChangeListener(checkBoxListener);
		box3.setOnCheckedChangeListener(checkBoxListener);

	}
	public void setTextEnable(String value){
		if(value.equals("")){
			text.setEnabled(true);
			return;
		}
		if(value.equalsIgnoreCase("")){
			
		}
		
	}
	

	
}
